package com.authManager.commons.feignApi;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.authManager.commons.feignApi.hystric.SysUserRoleApiHystric;
import com.authManager.entity.SysUserRole;
import com.commons.base.model.AdminPage;
import com.commons.base.model.ResultData;

@FeignClient(value = "authManager-server", fallback = SysUserRoleApiHystric.class)
public interface SysUserRoleApi {
	static final String projectAaaApiBaseUrl = "/authManager-server/admin/sysUserRole";

	/**
	 * 添加或者删除【用户角色关联表】
	 */
	@RequestMapping(value = projectAaaApiBaseUrl + "/addOrDelData", method = { RequestMethod.POST })
	public ResultData<Object> addOrDelData(@RequestParam(value = "sysUserId",required = true) String sysUserId,
			@RequestParam(value = "sysRoleId",required = true) Long sysRoleId);

	/**
	 * 修改【用户角色关联表】
	 */
	@RequestMapping(value = projectAaaApiBaseUrl + "/editSysUserRole", method = { RequestMethod.POST })
	public ResultData<Object> editSysUserRole(@RequestParam(value = "sysUserRoleId",required = true) Long sysUserRoleId,
			@RequestParam(value = "sysUserId",required = false) String sysUserId, @RequestParam(value = "sysRoleId",required = false) Long sysRoleId);

	/**
	 * 删除【用户角色关联表】
	 */
	@RequestMapping(value = projectAaaApiBaseUrl + "/delSysUserRole", method = { RequestMethod.POST })
	public ResultData<Object> delSysUserRole(@RequestParam(value = "sysUserRoleId",required = true) Long sysUserRoleId);

	/**
	 * 获取【用户角色关联表】
	 */
	@RequestMapping(value = projectAaaApiBaseUrl + "/getSysUserRole", method = { RequestMethod.POST })
	public ResultData<SysUserRole> getSysUserRole(@RequestParam(value = "sysUserRoleId",required = true) Long sysUserRoleId);

	/**
	 * 列表【用户角色关联表】
	 */
	@RequestMapping(value = projectAaaApiBaseUrl + "/listSysUserRole", method = { RequestMethod.POST })
	public ResultData<AdminPage<SysUserRole>> listSysUserRole(
			@RequestParam(value = "pageNum",defaultValue = "1", required = false) Integer pageNum,
			@RequestParam(value = "pageSize",defaultValue = "10", required = false) Integer pageSize,
			@RequestParam(value = "sysUserRoleId",required = false) Long sysUserRoleId, @RequestParam(value = "sysUserId",required = false) String sysUserId,
			@RequestParam(value = "sysRoleId",required = false) Long sysRoleId, @RequestParam(value = "start_createTime",required = false) String start_createTime,
			@RequestParam(value = "end_createTime",required = false) String end_createTime);
}
